package dto

import (
	"engine/model"
	"errors"
	"gorm.io/gorm"
	"lib/db"
)

type Agreement struct{}

func GetAgreementById(Id string) (*model.My_xieyi, error) {
	var agreemnet model.My_xieyi
	err := db.GetDb().Where("id = ?", Id).First(&agreemnet).Error
	if err != nil {
		if errors.Is(err, gorm.ErrRecordNotFound) {
			return nil, nil
		}
		return nil, err
	}
	return &agreemnet, nil
}
